1. Field
One embodiment of the invention relates to a storage device configured to read data from and write data on a medium with a head, and to a read/write processing method for the storage device. In particular, one embodiment of the invention relates to a storage device to which a read request for reading out music or video data is periodically issued from an external module, and to a read/write processing method for the storage device.
2. Description of the Related Art
A medium storage device such as a magnetic disk device and an optical disk device is configured to write data on a medium to store the data, and read data from the medium to reproduce the data stored in the medium using a head. In recent years, medium storage devices are used for storing music and video data. Such medium storage devices are also used as storage devices of a host such as a personal computer by being connected to the host.
As illustrated in FIG. 8, a medium storage device (HDD) 110 is internally or externally connected to a host 100 such as a personal computer or a mobile computer.
When music is started to be reproduced in a host 100, the host 100 reads out music data from the medium storage device 110. In particular, as illustrated in FIG. 9, the host 100 issues read requests to the medium storage device 110 at regular intervals, and receives music data and a status STS from the medium storage device 110 for each of the read requests, to reproduce the music.
In other words, since music or video changes over time, a large amount of memory will be required to read the entire music data desired. Accordingly, the host 100 requests to sequentially read each portion of the music data.
The host 100 also uses the medium storage device 110 as a storage device for other processing of the host 100, while performing the music reproduction. For example, the host 100 may boot the operating system (OS) or may start an application after booting the OS, and perform processing for the OS or for the application while reproducing the music. In this case, the host 100 may issue a write request to the medium storage device 110 in response to an instruction corresponding to log processing of the OS or an instruction to copy data or the like by the application processing.
In writing data to the medium storage device, received write-data is once stored in a cache memory (or a buffer memory) 120 (see FIG. 8), then written on the medium with a head. When the writing fails, the write-data in the cache memory 120 are read out and written again on the medium with the head (write retry). This writing failure may be caused by vibration imparted on the device from outside or by an environmental change such as a change in the temperature.
When the device is under influence of such vibration or the like, the writing may not succeed even the write retry is repeated a number of times, as long as the device is kept under the influence of the vibration. Therefore, conventionally, when there is a possibility that the writing failure may occur due to the vibration or the like, the write-data stored in the cache memory is stored into another semiconductor memory without performing the write retry. Then, when the possibility is removed, the saved write-data is written to the medium with a head.
The aforementioned write retry delays any action in response to the read request of the host. As illustrated in FIG. 10, when the host 100 issues a read request R1 to the medium storage device 110, the medium storage device 110 reads out music data corresponding to requested number of sectors from the medium, stores the read out data into the cache memory, and then transfers the data to the host 100. Subsequently, when the host 100 issues a write request W1 to the medium storage device 110, the medium storage device 110 stores the write-data from the host 100 into the cache memory 120, and then writes the write-data to the medium with the head.
In the aforementioned case, if the writing fails due to vibration or the like, a write retry is performed. During the write retry, when an application for reproducing music or video is activated, the host 100 issues read requests for music data or the like at regular intervals, as described with reference to FIG. 9.
When an external storage device is mounted on a notebook personal computer and a loudspeaker of the notebook personal computer is provided near the external storage device for example, the external storage device is likely to be vibrated due to the operation of the loudspeaker for music reproduction or the like. If a write command is issued in a state where such vibration is frequently generated, the write retry is likely to be performed. As a result, the reading becomes impossible to be performed even if the read commands are received at regular intervals from the host 100.
Accordingly, as illustrated in FIG. 10, the reading in accordance with the read commands is delayed at the host 100 until the writing is completed. As a result, the reproduction of the music or moving images is interrupted.